<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>lwIP: ext arguments</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">lwIP
   &#160;<span id="projectnumber">2.1.2</span>
   </div>
   <div id="projectbrief">Lightweight IP stack</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__tcp__raw__extargs.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">ext arguments<div class="ingroups"><a class="el" href="group__api.html">APIs</a> &raquo; <a class="el" href="group__callbackstyle__api.html">&quot;raw&quot; APIs</a> &raquo; <a class="el" href="group__tcp__raw.html">TCP</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga4836e0b4f66439493e106a50400d1616"><td class="memItemLeft" align="right" valign="top">u8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__tcp__raw__extargs.html#ga4836e0b4f66439493e106a50400d1616">tcp_ext_arg_alloc_id</a> (void)</td></tr>
<tr class="separator:ga4836e0b4f66439493e106a50400d1616"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga36e60dc02bfe0437c8da368a62e2f316"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__tcp__raw__extargs.html#ga36e60dc02bfe0437c8da368a62e2f316">tcp_ext_arg_set_callbacks</a> (struct <a class="el" href="structtcp__pcb.html">tcp_pcb</a> *pcb, uint8_t id, const struct <a class="el" href="structtcp__ext__arg__callbacks.html">tcp_ext_arg_callbacks</a> *const callbacks)</td></tr>
<tr class="separator:ga36e60dc02bfe0437c8da368a62e2f316"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga58500cb2ce22438e16a37373595af318"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__tcp__raw__extargs.html#ga58500cb2ce22438e16a37373595af318">tcp_ext_arg_set</a> (struct <a class="el" href="structtcp__pcb.html">tcp_pcb</a> *pcb, uint8_t id, void *arg)</td></tr>
<tr class="separator:ga58500cb2ce22438e16a37373595af318"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa8ac7a74407cb3e0e01a30314805f990"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__tcp__raw__extargs.html#gaa8ac7a74407cb3e0e01a30314805f990">tcp_ext_arg_get</a> (const struct <a class="el" href="structtcp__pcb.html">tcp_pcb</a> *pcb, uint8_t id)</td></tr>
<tr class="separator:gaa8ac7a74407cb3e0e01a30314805f990"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>Additional data storage per tcp pcb<br />
</p><dl class="section see"><dt>See also</dt><dd><a class="el" href="group__tcp__raw.html">TCP</a></dd></dl>
<p>When LWIP_TCP_PCB_NUM_EXT_ARGS is &gt; 0, every tcp pcb (including listen pcb) includes a number of additional argument entries in an array.</p>
<p>To support memory management, in addition to a 'void *', callbacks can be provided to manage transition from listening pcbs to connections and to deallocate memory when a pcb is deallocated (see struct <a class="el" href="structtcp__ext__arg__callbacks.html">tcp_ext_arg_callbacks</a>).</p>
<p>After allocating this index, use <a class="el" href="group__tcp__raw__extargs.html#ga58500cb2ce22438e16a37373595af318">tcp_ext_arg_set</a> and <a class="el" href="group__tcp__raw__extargs.html#gaa8ac7a74407cb3e0e01a30314805f990">tcp_ext_arg_get</a> to store and load arguments from this index for a given pcb. </p>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga4836e0b4f66439493e106a50400d1616"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga4836e0b4f66439493e106a50400d1616">&#9670;&nbsp;</a></span>tcp_ext_arg_alloc_id()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u8_t tcp_ext_arg_alloc_id </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Allocate an index to store data in ext_args member of struct <a class="el" href="structtcp__pcb.html">tcp_pcb</a>. Returned value is an index in mentioned array. The index is <em>global</em> over all pcbs!</p>
<p>When <a class="el" href="group__lwip__opts__tcp.html#ga40b1cdad52eaa91a3f5c242fc92ee223">LWIP_TCP_PCB_NUM_EXT_ARGS</a> is &gt; 0, every tcp pcb (including listen pcb) includes a number of additional argument entries in an array.</p>
<p>To support memory management, in addition to a 'void *', callbacks can be provided to manage transition from listening pcbs to connections and to deallocate memory when a pcb is deallocated (see struct <a class="el" href="structtcp__ext__arg__callbacks.html">tcp_ext_arg_callbacks</a>).</p>
<p>After allocating this index, use <a class="el" href="group__tcp__raw__extargs.html#ga58500cb2ce22438e16a37373595af318">tcp_ext_arg_set</a> and <a class="el" href="group__tcp__raw__extargs.html#gaa8ac7a74407cb3e0e01a30314805f990">tcp_ext_arg_get</a> to store and load arguments from this index for a given pcb.</p>
<dl class="section return"><dt>Returns</dt><dd>a unique index into struct tcp_pcb.ext_args </dd></dl>

</div>
</div>
<a id="gaa8ac7a74407cb3e0e01a30314805f990"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa8ac7a74407cb3e0e01a30314805f990">&#9670;&nbsp;</a></span>tcp_ext_arg_get()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void* tcp_ext_arg_get </td>
          <td>(</td>
          <td class="paramtype">const struct <a class="el" href="structtcp__pcb.html">tcp_pcb</a> *&#160;</td>
          <td class="paramname"><em>pcb</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>id</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Set data for a given index of ext_args on the specified pcb.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pcb</td><td><a class="el" href="structtcp__pcb.html">tcp_pcb</a> for which to set the data </td></tr>
    <tr><td class="paramname">id</td><td>ext_args index to set (allocated via <a class="el" href="group__tcp__raw__extargs.html#ga4836e0b4f66439493e106a50400d1616">tcp_ext_arg_alloc_id</a>) </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>data pointer at the given index </dd></dl>

</div>
</div>
<a id="ga58500cb2ce22438e16a37373595af318"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga58500cb2ce22438e16a37373595af318">&#9670;&nbsp;</a></span>tcp_ext_arg_set()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void tcp_ext_arg_set </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structtcp__pcb.html">tcp_pcb</a> *&#160;</td>
          <td class="paramname"><em>pcb</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>id</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>arg</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Set data for a given index of ext_args on the specified pcb.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pcb</td><td><a class="el" href="structtcp__pcb.html">tcp_pcb</a> for which to set the data </td></tr>
    <tr><td class="paramname">id</td><td>ext_args index to set (allocated via <a class="el" href="group__tcp__raw__extargs.html#ga4836e0b4f66439493e106a50400d1616">tcp_ext_arg_alloc_id</a>) </td></tr>
    <tr><td class="paramname">arg</td><td>data pointer to set </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga36e60dc02bfe0437c8da368a62e2f316"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga36e60dc02bfe0437c8da368a62e2f316">&#9670;&nbsp;</a></span>tcp_ext_arg_set_callbacks()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void tcp_ext_arg_set_callbacks </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structtcp__pcb.html">tcp_pcb</a> *&#160;</td>
          <td class="paramname"><em>pcb</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>id</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const struct <a class="el" href="structtcp__ext__arg__callbacks.html">tcp_ext_arg_callbacks</a> *const&#160;</td>
          <td class="paramname"><em>callbacks</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Set callbacks for a given index of ext_args on the specified pcb.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pcb</td><td><a class="el" href="structtcp__pcb.html">tcp_pcb</a> for which to set the callback </td></tr>
    <tr><td class="paramname">id</td><td>ext_args index to set (allocated via <a class="el" href="group__tcp__raw__extargs.html#ga4836e0b4f66439493e106a50400d1616">tcp_ext_arg_alloc_id</a>) </td></tr>
    <tr><td class="paramname">callbacks</td><td>callback table (const since it is referenced, not copied!) </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>
